﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyBanVeXe
{
    public partial class FormSaoLuu : Form
    {
        public FormSaoLuu()
        {
            InitializeComponent();
        }

        private void FormSaoLuu_Load(object sender, EventArgs e)
        {
            this.AcceptButton = this.btOK;
        }

        private void btOK_Click(object sender, EventArgs e)
        {
            if (txtDuongDan.Text.Trim().Length != 0)
            {
                this.Close();
            }
            else
            {
                MessageBox.Show("Hãy nhập đường dẫn để sao lưu");
                txtDuongDan.Focus();
            }
        }

        private void btCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        public string DuongDan()
        {
            return @txtDuongDan.Text + ".bak";
        }

        private void btnDuongDan_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult dlg = saveFileDialog1.ShowDialog();
                if (dlg == DialogResult.OK)
                {
                    this.txtDuongDan.Text = saveFileDialog1.FileName;
                }
            }
            catch { }
        }

    }
}
